import { Ref } from "vue";
import { JxtechInputBean } from "@whjxtech/jxtech-component";

/**
 * 使用编辑表格
 * @param editTableRef JxtechEditTableExt的ref实例
 */
export function useJxtechEditTableExt(editTableRef: Ref<any>) {
  /**加载表格 */
  const loadTable = () => editTableRef.value.loadTable();
  /**
   * 获取inputBean值
   */
  const getInputBean = () => editTableRef.value.getInputBean() as JxtechInputBean;
  /**
   * 新增行数据
   * @param data 数据
   */
  const addRowData = (data?: any) => editTableRef.value.addRowData(data);
  return { loadTable, getInputBean, addRowData };
}
